home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxcrc32.zip / CRC of String.CMD < prev    next >
OS/2 REXX Batch file  |  1998-01-24  |  1KB  |  41 lines

  1. /* RxCRC32-Test: Calculate CRC-32 of Entered String *
  2.  *                                                  *
  3.  * (C) Mads Orbesen Troest & SIRIUS Cybernetics     */
  4.  
  5. /* Load External RxCRC32 Routines: */
  6.  
  7. CALL RxFuncAdd "RxCRC32Ver",    "RXCRC32", "RXCRC32VER"
  8. CALL RxFuncAdd "RxCRC32Init",   "RXCRC32", "RXCRC32INIT"
  9. CALL RxFuncAdd "RxCRC32Done",   "RXCRC32", "RXCRC32DONE"
  10. CALL RxFuncAdd "RxCRC32Update", "RXCRC32", "RXCRC32UPDATE"
  11.  
  12. /* Do some initial chitchat: */
  13.  
  14. SAY ""
  15. SAY "RxCRC32-Test: Calculate CRC-32 of Entered String, utilising:"
  16. SAY RxCRC32Ver() /* Report Version Information */
  17. SAY ""
  18.  
  19. /* Initialize the variable CRC for running CRC-32 calculation: */
  20.  
  21. CRC = RxCRC32Init()
  22.  
  23. /* Get the buffer to calculate: */
  24.  
  25. SAY "Whack in some line that you want me to calculate the CRC-32 of:"
  26. PARSE PULL Buffer
  27.  
  28. /* Calculate CRC-32 of Buffer: */
  29.  
  30. CRC = RxCRC32Update( CRC, Buffer )
  31.  
  32. /* Complete Calculation: */
  33.  
  34. CRC = RxCRC32Done( CRC )
  35.  
  36. /* Report the result: */
  37.  
  38. SAY ""
  39. SAY "Well, then... CRC-32 : "CRC" (HEX) - Thanks for using RxCRC32 :-)"
  40.  
  41.